<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'新建:'.$folder_name))}
	<div class="frame">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
			<input type="hidden" id="scope_user_id" name="scope_user_id" value="">
			<input type="hidden" id="scope_user_name" name="scope_user_name" value="">
			<input type="hidden" id="ajax" name="ajax" value="0">
			<input type="hidden" id="folder" name="folder" value="{$folder}">
			<input type="hidden" id="fid" name="fid" value="{$folder}">
			<input type="hidden" id="opmode" name="opmode" value="add">
			<input name="is_sign" type="hidden" value="1">
			<div class="box">
				<label class="input-label" for="name">标题*：</label>
				<input class="input" type="text" id="name" name="name" check='required' info='请输入文件名' >
			</div>
			<div class="box">
				<label class="input-label" >发布范围：</label>
				<div id="actor_wrap" class="multi-select-box">
					<span class="data-list"></span>
					<input class="letter" type="text" >
					<label></label>
					<div class="search hidden">
						<ul></ul>
					</div>
				</div>
				<a class="add-on" onclick="select_actor();"><i class="fa fa-user"></i></a>
			</div>
			<div class="box">
				<label class="input-label" for="location">内容：</label>
				<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;" check="required" info="请输入内容"></textarea>
			</div>
			<div class="box">
				<label class="input-label">附件：</label>
				{:widget('file_upload/add')}
			</div>
			<div class="box">
				<label class="input-label"></label>
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a  class="btn btn-return" onclick="go_return_url();">取消</a>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'editor','uploader'], function() {
			var $ = layui.jquery;
			var fn = {
				select_actor : function() {
					winopen("{:url('Popup/scope')}", 560, 470);
				},
				save : function() {
					$("#scope_user_name").val("");
					$("#actor_wrap span.address_list span").each(function() {
						$("#scope_user_name").val($("#scope_user_name").val() + $(this).text().replace(';', '') + '|' + $(this).attr("data") + ";");
					});

					$("#scope_user_id").val("");
					$("#actor_wrap span.address_list span").each(function() {
						$("#scope_user_id").val($("#scope_user_id").val() + $(this).attr("data") + ",");
					});

					send_form('form_data', "{:url('save')}", '', function() {

					});
				}
			};

			win_exp(fn);
		});
	</script>
</block>